/**
 * Created by huachuan on 2015/12/26.
 */
angular.module("memorecontroller",[])
  .controller('MoreCtrl',function($scope,$state,Member,Storage){

    var storageKey = 'member';

    $scope.$on('$ionicView.beforeEnter',function(){
      if(Storage.get(storageKey)==null || Storage.get(storageKey)==''){
        $state.go('login');
      }
    });

    //退出登录
    $scope.logout = function(){
      Member.logout();
      Member.setFirstInLogin();//不是第一次到登录界面
      $state.go('login');
    }

  })
;
